<!--#include file="admin/Includes/constants.asp"-->
<!--#include file="admin/Includes/validate.asp"-->
<%
Dim Action, AlbumID, DocType, DocID
Dim referer, isLogin, strURL
SSLMode = 1
'------------Authentication----------------------------
Verify
'------------Authentication----------------------------
MakeSSL 1

Action = request("a")
AlbumID=0 'not used
DocType = request("dt") '3.picture, 2.articles, 1. subcategory
DocID = request("fid") 
referer = Request.ServerVariables("HTTP_REFERER")
isLogin=instr(referer,"login.asp")
strURL=Right(Request.ServerVariables("Script_name"),Len(Request.ServerVariables("Script_name"))-1) & "?" & Request.ServerVariables("QUERY_STRING")

If Action<>"" Then
	strSQL = "{CALL a_user_favimg_add('"&Action&"','"&CookieID&"',"&AlbumID&","&DocType&","&DocID&")}"
	exec(strsql)
	
	If isLogin > 0 Then
		Select Case DocType
			Case 1
				strURL = replace(strURL, "user_fav_add", "listing") & "&msg=1"
				go strURL
			Case Else
				strURL = replace(strURL, "user_fav_add", "detail") & "&msg=1"
				strURL = replace(strURL, "&fid=", "&aid=") 
				go strURL
		End Select
	End If
	
	If instr(referer,"msg=1") > 0 Then
		go referer
	Else
		go referer & "&msg=1"	
	End If
	
end if
CloseCon
%>
